﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
  xmlns:aero="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" 
  xmlns:converters="clr-namespace:Common.Converters;assembly=Common"
  xmlns:controls="clr-namespace:Common.Controls;assembly=Common">

  <converters:IndexToIsAlternateRowConverter x:Key="IndexToIsAlternateRowConverter" />
  <converters:ImageConverter x:Key="ImageConverter" />

    <SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FF3A3905" />
    <LinearGradientBrush x:Key="SecondaryBackgroundBrush" StartPoint="0.5,0" EndPoint="0.5,1">
    <GradientStop Color="#FFFBFCFE" Offset="0" />
    <GradientStop Color="#FFE2E8F4" Offset="0.5" />
    <GradientStop Color="#FFD1D9EC" Offset="0.5" />
    <GradientStop Color="#FFEAECFB" Offset="1" />
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="StatusBackgroundBrush" StartPoint="0.5,1" EndPoint="0.5,0">
    <GradientStop Color="#FF000000" Offset="0"/>
    <GradientStop Color="#FF9AC6CF" Offset="0.0494537"/>
    <GradientStop Color="#FF54A1AA" Offset="0.0714264"/>
    <GradientStop Color="#FF146478" Offset="0.5"/>
    <GradientStop Color="#FF408C9A" Offset="0.505493"/>
    <GradientStop Color="#FF87B6C0" Offset="0.928574"/>
    <GradientStop Color="#FFBCCDD7" Offset="0.950546"/>
    <GradientStop Color="#FFAEBFCA" Offset="0.983521"/>
    <GradientStop Color="#FFAEBFCA" Offset="1"/>
  </LinearGradientBrush>

  <SolidColorBrush x:Key="PrimaryBorderBrush" Color="#FF222B34" />

  <SolidColorBrush x:Key="ImageBorderBrush" Color="#FF52626F" />

  <SolidColorBrush x:Key="SubForegroundBrush" Color="#FF999999" />

  <DataTemplate x:Key="TweetsTemplate">
    <DataTemplate.Resources>
      <Storyboard x:Key="YellowFade">
        <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" FillBehavior="Stop">
          <SplineColorKeyFrame KeyTime="00:00:00" Value="#FFFEFF76" />
          <SplineColorKeyFrame KeyTime="00:00:01" Value="#19FEFF76" />
        </ColorAnimationUsingKeyFrames>
      </Storyboard>
      <Storyboard x:Key="YellowForever">
        <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
          <SplineColorKeyFrame KeyTime="00:00:00" Value="#FFFEFF76" />
          <SplineColorKeyFrame KeyTime="00:00:01" Value="#FFFEFF76" />
        </ColorAnimationUsingKeyFrames>
      </Storyboard>
    </DataTemplate.Resources>
        <DockPanel x:Name="grid" Background="Transparent">
            <Image DockPanel.Dock="Left" Width="35" Height="35" Margin="0,0,5,0" Source="{Binding Path=User.ImageUrl, Converter={StaticResource ImageConverter}}" x:Name="UserImage" />
            <StackPanel DockPanel.Dock="Right" Width="Auto">
                <DockPanel VerticalAlignment="Top">
                    <TextBlock Text="{Binding Path=User.ScreenName, FallbackValue=Screen Name}" FontWeight="Bold" FontSize="12" VerticalAlignment="Bottom" HorizontalAlignment="Left" x:Name="ScreenName" Cursor="Hand" ToolTip="View this user's recent tweets" />
                <Button Width="20" Height="Auto" HorizontalAlignment="Right" Margin="0,0,2,0" Visibility="Collapsed" x:Name="ReplyButton">
                    <TextBlock TextWrapping="Wrap" Text="@" VerticalAlignment="Center" x:Name="textBlock" />
                </Button>
                <TextBlock VerticalAlignment="Center" FontSize="9" Text="{Binding Path=RelativeTime, FallbackValue=1 minute ago}" FontStyle="Italic" Margin="2,2,2,2" Foreground="{DynamicResource SubForegroundBrush}" ToolTip="{Binding Path=DateCreated, Mode=Default}" />
                <TextBlock VerticalAlignment="Center" FontSize="9" Text="{Binding Path=Source, Mode=Default, FallbackValue=来自 web}" FontStyle="Italic" TextTrimming="CharacterEllipsis" Foreground="{DynamicResource SubForegroundBrush}" />
              </DockPanel>
              <controls:TweetTextBlock x:Name="TweetText" FontSize="11" TweetText="{Binding Path=Text, FallbackValue=Tweet Text}" TextWrapping="Wrap" Margin="0,0,1,0" />
            </StackPanel>
        </DockPanel>
        <DataTemplate.Triggers>
      <Trigger Property="IsMouseOver" Value="True" SourceName="ScreenName">
        <Setter Property="Foreground" Value="#FF177E8C" TargetName="ScreenName"/>
      </Trigger>
      <DataTrigger Binding="{Binding Path=IsNew}" Value="True">
        <DataTrigger.EnterActions>
          <BeginStoryboard Storyboard="{StaticResource YellowFade}" x:Name="YellowFade_BeginStoryboard" />
        </DataTrigger.EnterActions>
      </DataTrigger>
      <DataTrigger Binding="{Binding Path=IsInteresting}" Value="True">
        <DataTrigger.EnterActions>
         <BeginStoryboard Storyboard="{StaticResource YellowForever}" x:Name="YellowForever_BeginStoryboard" />
        </DataTrigger.EnterActions>
      </DataTrigger>

      <DataTrigger Binding="{Binding Path=IsReply}" Value="true">
          <DataTrigger.Setters>
              <Setter Property="Background" Value="{StaticResource ReplyTweetBrush}" TargetName="grid"/>
          </DataTrigger.Setters>
      </DataTrigger>

      <DataTrigger Binding="{Binding Path=Timeline}" Value="DirectMessages">
          <DataTrigger.Setters>
              <Setter Property="Background" Value="{StaticResource DirectMessageBrush}" TargetName="grid"/>
          </DataTrigger.Setters>
      </DataTrigger>

        <!--<Trigger Property="IsMouseOver" Value="True">
			<Setter Property="Visibility" TargetName="ReplyButton" Value="Visible"/>
		  </Trigger>-->
    </DataTemplate.Triggers>
  </DataTemplate>
  
  <DataTemplate x:Key="RepliesTemplate">
    <DataTemplate.Resources>
      <Storyboard x:Key="YellowFade">
        <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" FillBehavior="Stop">
          <SplineColorKeyFrame KeyTime="00:00:00" Value="#FFFEFF76" />
          <SplineColorKeyFrame KeyTime="00:00:01" Value="#19FEFF76" />
        </ColorAnimationUsingKeyFrames>
      </Storyboard>
      <Storyboard x:Key="YellowForever">
        <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
          <SplineColorKeyFrame KeyTime="00:00:00" Value="#FFFEFF76" />
          <SplineColorKeyFrame KeyTime="00:00:01" Value="#FFFEFF76" />
        </ColorAnimationUsingKeyFrames>
      </Storyboard>
    </DataTemplate.Resources>
        <DockPanel x:Name="grid" Background="Transparent">
            <Image DockPanel.Dock="Left" Width="35" Height="35" Margin="0,0,5,0" Source="{Binding Path=User.ImageUrl, Converter={StaticResource ImageConverter}}" x:Name="UserImage" />
            <StackPanel DockPanel.Dock="Right" Width="Auto">
                <DockPanel VerticalAlignment="Top">
                    <TextBlock Text="{Binding Path=User.ScreenName, FallbackValue=Screen Name}" FontWeight="Bold" FontSize="12" VerticalAlignment="Bottom" HorizontalAlignment="Left" x:Name="ScreenName" Cursor="Hand" ToolTip="View this user's recent tweets" />
                <Button Width="20" Height="Auto" HorizontalAlignment="Right" Margin="0,0,2,0" Visibility="Collapsed" x:Name="ReplyButton">
                    <TextBlock TextWrapping="Wrap" Text="@" VerticalAlignment="Center" x:Name="textBlock" />
                </Button>
                <TextBlock VerticalAlignment="Center" FontSize="9" Text="{Binding Path=RelativeTime, FallbackValue=1 minute ago}" FontStyle="Italic" Margin="2,2,2,2" Foreground="{DynamicResource SubForegroundBrush}" ToolTip="{Binding Path=DateCreated, Mode=Default}" />
              </DockPanel>
              <controls:TweetTextBlock x:Name="TweetText" FontSize="11" TweetText="{Binding Path=Text, FallbackValue=Tweet Text}" TextWrapping="Wrap" Margin="0,0,1,0" />
            </StackPanel>
        </DockPanel>
        <DataTemplate.Triggers>
      <Trigger Property="IsMouseOver" Value="True" SourceName="ScreenName">
        <Setter Property="Foreground" Value="#FF177E8C" TargetName="ScreenName"/>
      </Trigger>
      <DataTrigger Binding="{Binding Path=IsNew}" Value="True">
        <DataTrigger.EnterActions>
          <BeginStoryboard Storyboard="{StaticResource YellowFade}" x:Name="YellowFade_BeginStoryboard" />
        </DataTrigger.EnterActions>
      </DataTrigger>
      <DataTrigger Binding="{Binding Path=IsInteresting}" Value="True">
        <DataTrigger.EnterActions>
         <BeginStoryboard Storyboard="{StaticResource YellowForever}" x:Name="YellowForever_BeginStoryboard" />
        </DataTrigger.EnterActions>
      </DataTrigger>

      <DataTrigger Binding="{Binding Path=IsReply}" Value="true">
          <DataTrigger.Setters>
              <Setter Property="Background" Value="{StaticResource ReplyTweetBrush}" TargetName="grid"/>
          </DataTrigger.Setters>
      </DataTrigger>

      <DataTrigger Binding="{Binding Path=Timeline}" Value="DirectMessages">
          <DataTrigger.Setters>
              <Setter Property="Background" Value="{StaticResource DirectMessageBrush}" TargetName="grid"/>
          </DataTrigger.Setters>
      </DataTrigger>

        <!--<Trigger Property="IsMouseOver" Value="True">
			<Setter Property="Visibility" TargetName="ReplyButton" Value="Visible"/>
		  </Trigger>-->
    </DataTemplate.Triggers>
  </DataTemplate>


    <DataTemplate x:Key="MoreTemplate">
        <DataTemplate.Resources>
            <Storyboard x:Key="YellowFade">
                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" FillBehavior="Stop">
                    <SplineColorKeyFrame KeyTime="00:00:00" Value="#FFFEFF76" />
                    <SplineColorKeyFrame KeyTime="00:00:01" Value="#19FEFF76" />
                </ColorAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Key="YellowForever">
                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
                    <SplineColorKeyFrame KeyTime="00:00:00" Value="#FFFEFF76" />
                    <SplineColorKeyFrame KeyTime="00:00:01" Value="#FFFEFF76" />
                </ColorAnimationUsingKeyFrames>
            </Storyboard>
        </DataTemplate.Resources>
        <DockPanel x:Name="grid" Background="#01FFFFFF">
            <Image DockPanel.Dock="Left" Width="35" Height="35" Margin="0,0,5,0" Source="{Binding Path=User.ImageUrl, Converter={StaticResource ImageConverter}}" x:Name="UserImage" />
            <StackPanel DockPanel.Dock="Right" Width="Auto">
                <DockPanel VerticalAlignment="Top">
                    <TextBlock Text="{Binding Path=User.ScreenName, FallbackValue=Screen Name}" FontWeight="Bold" FontSize="12" VerticalAlignment="Bottom" HorizontalAlignment="Left" x:Name="ScreenName" Cursor="Hand" ToolTip="View this user's recent tweets" />
                    <Button Width="20" Height="Auto" HorizontalAlignment="Right" Margin="0,0,2,0" Visibility="Collapsed" x:Name="ReplyButton">
                        <TextBlock TextWrapping="Wrap" Text="@" VerticalAlignment="Center" x:Name="textBlock" />
                    </Button>
                    <TextBlock VerticalAlignment="Center" FontSize="9" Text="{Binding Path=RelativeTime, FallbackValue=1 minute ago}" FontStyle="Italic" Margin="2,2,2,2" Foreground="{DynamicResource SubForegroundBrush}" ToolTip="{Binding Path=DateCreated, Mode=Default}" />
                    <TextBlock VerticalAlignment="Center" FontSize="9" Text="{Binding Path=Source, Mode=Default, FallbackValue=来自 web}" FontStyle="Italic" TextTrimming="CharacterEllipsis" Foreground="{DynamicResource SubForegroundBrush}" />
                </DockPanel>
                <controls:TweetTextBlock x:Name="TweetText" FontSize="11" TweetText="{Binding Path=Text, FallbackValue=Tweet Text}" TextWrapping="Wrap" Margin="0,0,1,0" />
            </StackPanel>
        </DockPanel>
        <DataTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True" SourceName="ScreenName">
                <Setter Property="Foreground" Value="#FF177E8C" TargetName="ScreenName"/>
            </Trigger>
            <DataTrigger Binding="{Binding Path=IsNew}" Value="True">
                <DataTrigger.EnterActions>
                    <BeginStoryboard Storyboard="{StaticResource YellowFade}" x:Name="YellowFade_BeginStoryboard" />
                </DataTrigger.EnterActions>
            </DataTrigger>
            <DataTrigger Binding="{Binding Path=IsInteresting}" Value="True">
                <DataTrigger.EnterActions>
                    <BeginStoryboard Storyboard="{StaticResource YellowForever}" x:Name="YellowForever_BeginStoryboard" />
                </DataTrigger.EnterActions>
            </DataTrigger>

            <DataTrigger Binding="{Binding Path=IsReply}" Value="true">
                <DataTrigger.Setters>
                    <Setter Property="Background" Value="{StaticResource ReplyTweetBrush}" TargetName="grid"/>
                </DataTrigger.Setters>
            </DataTrigger>

            <DataTrigger Binding="{Binding Path=Timeline}" Value="DirectMessages">
                <DataTrigger.Setters>
                    <Setter Property="Background" Value="{StaticResource DirectMessageBrush}" TargetName="grid"/>
                </DataTrigger.Setters>
            </DataTrigger>

            <!--<Trigger Property="IsMouseOver" Value="True">
			<Setter Property="Visibility" TargetName="ReplyButton" Value="Visible"/>
		  </Trigger>-->
        </DataTemplate.Triggers>
    </DataTemplate>

    <DataTemplate x:Key="MessagesTemplate">
    <DataTemplate.Resources>
      <Storyboard x:Key="YellowFade">
        <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
          <SplineColorKeyFrame KeyTime="00:00:00" Value="#FFFEFF76" />
          <SplineColorKeyFrame KeyTime="00:00:01" Value="#19FEFF76" />
        </ColorAnimationUsingKeyFrames>
      </Storyboard>
    </DataTemplate.Resources>
        <DockPanel x:Name="grid" Background="#01FFFFFF">
            <Image DockPanel.Dock="Left" Width="35" Height="35" Margin="0,0,5,0" Source="{Binding Path=Sender.ImageUrl, Converter={StaticResource ImageConverter}}" x:Name="UserImage" />
            <StackPanel DockPanel.Dock="Right" Width="Auto">
                <DockPanel VerticalAlignment="Top">
                    <TextBlock Text="{Binding Path=Sender.ScreenName, FallbackValue=Screen Name}" FontWeight="Bold" FontSize="12" VerticalAlignment="Bottom" HorizontalAlignment="Left" x:Name="ScreenName" Cursor="Hand" ToolTip="View this user's recent tweets" />
                <Button Width="20" Height="Auto" HorizontalAlignment="Right" Margin="0,0,2,0" Visibility="Collapsed" x:Name="ReplyButton">
                    <TextBlock TextWrapping="Wrap" Text="@" VerticalAlignment="Center" x:Name="textBlock" />
                </Button>
                <TextBlock VerticalAlignment="Center" FontSize="9" Text="{Binding Path=RelativeTime, FallbackValue=1 minute ago}" FontStyle="Italic" Margin="2,2,2,2" Foreground="{DynamicResource SubForegroundBrush}" ToolTip="{Binding Path=DateCreated, Mode=Default}" />
                <TextBlock VerticalAlignment="Center" FontSize="9" Text="{Binding Path=Source, Mode=Default, FallbackValue=来自 web}" FontStyle="Italic" TextTrimming="CharacterEllipsis" Foreground="{DynamicResource SubForegroundBrush}" />
              </DockPanel>
                <controls:TweetTextBlock x:Name="TweetText" FontSize="11" TweetText="{Binding Path=Text, FallbackValue=Tweet Text}" TextWrapping="Wrap" Margin="0,0,1,0" />
            </StackPanel>
        </DockPanel>
        <DataTemplate.Triggers>
      <DataTrigger Binding="{Binding Path=IsNew}" Value="True">
        <DataTrigger.EnterActions>
          <BeginStoryboard Storyboard="{StaticResource YellowFade}" />
        </DataTrigger.EnterActions>
      </DataTrigger>
    </DataTemplate.Triggers>
  </DataTemplate>

  <SolidColorBrush x:Key="ForegroundBrush" Color="#FF000000" />
  <SolidColorBrush x:Key="HeaderForegroundBrush" Color="#FFFFFFFF" />
  <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888" />

  <LinearGradientBrush x:Key="ListHoverBrush" StartPoint="0,0" EndPoint="0,1">
    <GradientStop Color="#FFDFECFA" Offset="0" />
    <GradientStop Color="#FFC7E0FB" Offset="1" />
  </LinearGradientBrush>

  <SolidColorBrush x:Key="UpdateBackgroundBrush" Color="#FFA8B9C6" />
  <SolidColorBrush  x:Key="ReplyTweetBrush" Color="#FFF5F59A"/>
  <SolidColorBrush  x:Key="DirectMessageBrush" Color="#FFD5DCE1"/>

  <Style x:Key="{x:Type controls:TweetTextBlock}">
        <Setter Property="Hyperlink.Foreground" Value="Green"/>
        <Style.Triggers>
            <Trigger Property="Hyperlink.IsMouseOver" Value="True">
                <Setter Property="Hyperlink.Foreground" Value="Orange"/>
            </Trigger>
            <Trigger Property="Hyperlink.IsEnabled" Value="False">
                <Setter Property="Hyperlink.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
            </Trigger>
            <Trigger Property="Hyperlink.IsEnabled" Value="True">
                <Setter Property="Hyperlink.Cursor" Value="Hand"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    
    <Style x:Key="{x:Type ListBoxItem}" TargetType="ListBoxItem">
    <Setter Property="SnapsToDevicePixels" Value="true" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ListBoxItem">
          <Border x:Name="Border" Padding="2" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource LightBorderBrush}">
            <ContentPresenter />
          </Border>
          <ControlTemplate.Triggers>
            <!--<Trigger Property="IsSelected" Value="true">
                <Setter Property="Background" Value="{StaticResource SelectedBackgroundBrush}"/>
            </Trigger>-->
            <!--
            <DataTrigger Binding="{Binding Index, Converter={StaticResource IndexToIsAlternateRowConverter}}" Value="true">
              <Setter Property="Background" Value="{StaticResource AlternatingBackgroundBrush}" />
            </DataTrigger>
            -->
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="Background" Value="{StaticResource ListHoverBrush}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <DataTemplate x:Key="UserTimeLineTemplate">
    <DataTemplate.Resources>
      <Storyboard x:Key="YellowFade">
        <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
          <SplineColorKeyFrame KeyTime="00:00:00" Value="#FFFEFF76" />
          <SplineColorKeyFrame KeyTime="00:00:01" Value="#19FEFF76" />
        </ColorAnimationUsingKeyFrames>
      </Storyboard>
    </DataTemplate.Resources>
    <Grid x:Name="grid" Background="Transparent" Margin="7,7,7,8">
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
      </Grid.RowDefinitions>
            <controls:TweetTextBlock x:Name="TweetText" TweetText="{Binding Path=Text, FallbackValue=Tweet Text}" TextWrapping="Wrap"></controls:TweetTextBlock>
            <StackPanel Grid.Column="0" Grid.Row="1" Orientation="Horizontal">
        <TextBlock Text="{Binding Path=RelativeTime, FallbackValue=1 minute ago}" FontStyle="Italic" Foreground="{DynamicResource SubForegroundBrush}" ToolTip="{Binding Path=DateCreated, Mode=Default}" Margin="0,0,3,0" />
        <TextBlock Text="{Binding Path=Source, Mode=Default, FallbackValue=来自 web}" FontStyle="Italic" TextTrimming="CharacterEllipsis" Foreground="{DynamicResource SubForegroundBrush}" />
      </StackPanel>
    </Grid>
    <DataTemplate.Triggers>
      <DataTrigger Binding="{Binding Path=IsNew}" Value="True">
        <DataTrigger.EnterActions>
          <BeginStoryboard Storyboard="{StaticResource YellowFade}" />
        </DataTrigger.EnterActions>
      </DataTrigger>
    </DataTemplate.Triggers>
    </DataTemplate>

  <!-- Fill Brushes -->

  <SolidColorBrush x:Key="ButtonForegroundBrush" Color="#FFF" />

  <LinearGradientBrush x:Key="NormalBrush" StartPoint="0,0" EndPoint="0,1">
    <GradientStop Color="#FF7CA1E3" Offset="0" />
    <GradientStop Color="#FF5B78BF" Offset="0.5" />
    <GradientStop Color="#FF193B9D" Offset="0.5" />
    <GradientStop Color="#FF2696CD" Offset="1" />
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="HoverBrush" EndPoint="0,1" StartPoint="0,0">
    <GradientStop Color="#FFADBFE0" Offset="0" />
    <GradientStop Color="#FF5B78BF" Offset="0.5" />
    <GradientStop Color="#FF193B9D" Offset="0.5" />
    <GradientStop Color="#FF99D1EC" Offset="1" />
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="HorizontalNormalBrush" StartPoint="0,0" EndPoint="1,0">
    <GradientStop Color="#FF7CA1E3" Offset="0" />
    <GradientStop Color="#FF5B78BF" Offset="0.5" />
    <GradientStop Color="#FF193B9D" Offset="0.5" />
    <GradientStop Color="#FF2696CD" Offset="1" />
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="LightBrush" StartPoint="0,0" EndPoint="0,1">
    <GradientBrush.GradientStops>
      <GradientStopCollection>
        <GradientStop Color="#FFF" Offset="0.0" />
        <GradientStop Color="#EEE" Offset="1.0" />
      </GradientStopCollection>
    </GradientBrush.GradientStops>
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="HorizontalLightBrush" StartPoint="0,0" EndPoint="1,0">
    <GradientBrush.GradientStops>
      <GradientStopCollection>
        <GradientStop Color="#FFF" Offset="0.0" />
        <GradientStop Color="#EEE" Offset="1.0" />
      </GradientStopCollection>
    </GradientBrush.GradientStops>
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="PressedBrush" StartPoint="0,0" EndPoint="0,1">
    <GradientStop Color="#FF5A7AB3" Offset="0" />
    <GradientStop Color="#FF5B78BF" Offset="0.5" />
    <GradientStop Color="#FF193B9D" Offset="0.5" />
    <GradientStop Color="#FF20749D" Offset="1" />
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="DisabledBackgroundBrush" EndPoint="0,1" StartPoint="0,0">
    <GradientStop Color="#FFDDDFE4" Offset="0" />
    <GradientStop Color="#FFBCBCBF" Offset="0.5" />
    <GradientStop Color="#FF9B9C9F" Offset="0.529" />
    <GradientStop Color="#FFC9CBCC" Offset="1" />
  </LinearGradientBrush>

  <SolidColorBrush x:Key="WindowBackgroundBrush" Color="#FFF" />

  <LinearGradientBrush x:Key="LoginBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
    <GradientBrush.GradientStops>
      <GradientStopCollection>
        <GradientStop Color="#FFF" Offset="0.0" />
        <GradientStop Color="#CCC" Offset="1.0" />
      </GradientStopCollection>
    </GradientBrush.GradientStops>
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="SelectedBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
    <GradientStop Color="#FF7CA1E3" Offset="0" />
    <GradientStop Color="#FF5B78BF" Offset="0.5" />
    <GradientStop Color="#FF193B9D" Offset="0.5" />
    <GradientStop Color="#FF2696CD" Offset="1" />
  </LinearGradientBrush>

  <!-- Border Brushes -->

  <SolidColorBrush x:Key="NormalBorderBrush" Color="#FF57C6EF" />

  <LinearGradientBrush x:Key="HorizontalNormalBorderBrush" StartPoint="0,0" EndPoint="1,0">
    <GradientBrush.GradientStops>
      <GradientStopCollection>
        <GradientStop Color="#CCC" Offset="0.0" />
        <GradientStop Color="#444" Offset="1.0" />
      </GradientStopCollection>
    </GradientBrush.GradientStops>
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="DefaultedBorderBrush" StartPoint="0,0" EndPoint="0,1">
    <GradientBrush.GradientStops>
      <GradientStopCollection>
        <GradientStop Color="#FF385CBC" Offset="0.0" />
        <GradientStop Color="#FF193D9E" Offset="1.0" />
      </GradientStopCollection>
    </GradientBrush.GradientStops>
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="PressedBorderBrush" StartPoint="0,0" EndPoint="0,1">
    <GradientBrush.GradientStops>
      <GradientStopCollection>
        <GradientStop Color="#444" Offset="0.0" />
        <GradientStop Color="#888" Offset="1.0" />
      </GradientStopCollection>
    </GradientBrush.GradientStops>
  </LinearGradientBrush>

  <SolidColorBrush x:Key="SelectedBorderBrush" Color="#888" />

  <SolidColorBrush x:Key="DisabledBorderBrush" Color="#AAA" />

  <SolidColorBrush x:Key="SolidBorderBrush" Color="#888" />

  <SolidColorBrush x:Key="LightBorderBrush" Color="#AAA" />

  <!-- Miscellaneous Brushes -->
  <SolidColorBrush x:Key="GlyphBrush" Color="#fff" />

  <SolidColorBrush x:Key="LightColorBrush" Color="#DDD" />

  <Style x:Key="ButtonFocusVisual">
    <Setter Property="Control.Template">
      <Setter.Value>
        <ControlTemplate>
          <Border>
            <Rectangle Margin="2" StrokeThickness="1" Stroke="#60000000" StrokeDashArray="1 2" />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="{x:Type Button}">
    <Setter Property="SnapsToDevicePixels" Value="true" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}" />
    <Setter Property="Background" Value="{StaticResource ForegroundBrush}" />
    <Setter Property="BorderBrush" Value="{StaticResource NormalBorderBrush}" />
    <Setter Property="Foreground" Value="{StaticResource ButtonForegroundBrush}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Button}">
          <Border x:Name="Border" CornerRadius="5" BorderThickness="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}">
            <ContentPresenter Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True" />
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsKeyboardFocused" Value="true">
              <Setter Property="BorderBrush" Value="{StaticResource DefaultedBorderBrush}" />
            </Trigger>
            <Trigger Property="IsDefaulted" Value="true">
              <Setter Property="BorderBrush" Value="{StaticResource DefaultedBorderBrush}" />
              <Setter TargetName="Border" Property="BorderThickness" Value="2" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="Background" Value="{StaticResource HoverBrush}" />
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter Property="Background" Value="{StaticResource PressedBrush}" />
              <Setter Property="BorderBrush" Value="{StaticResource PressedBorderBrush}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
              <Setter Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
              <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="ScrollBarLineButton" TargetType="{x:Type RepeatButton}">
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="Focusable" Value="false" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Border Name="Border" Margin="1" CornerRadius="2" Background="{StaticResource NormalBrush}" BorderBrush="{StaticResource NormalBorderBrush}" BorderThickness="1">
            <Path HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{StaticResource GlyphBrush}" Data="{Binding Path=Content,RelativeSource={RelativeSource TemplatedParent}}" />
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsPressed" Value="true">
              <Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="IsTabStop" Value="false" />
    <Setter Property="Focusable" Value="false" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Border Background="Transparent" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="IsTabStop" Value="false" />
    <Setter Property="Focusable" Value="false" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Thumb}">
          <Border CornerRadius="2" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
    <Grid>
      <Grid.RowDefinitions>
        <RowDefinition MaxHeight="18" />
        <RowDefinition Height="0.00001*" />
        <RowDefinition MaxHeight="18" />
      </Grid.RowDefinitions>
      <Border Grid.RowSpan="3" CornerRadius="2" />
      <RepeatButton Grid.Row="0" Style="{StaticResource ScrollBarLineButton}" Height="18" Command="ScrollBar.LineUpCommand" Content="M 0 4 L 8 4 L 4 0 Z" />
      <Track Name="PART_Track" Grid.Row="1" IsDirectionReversed="true">
        <Track.DecreaseRepeatButton>
          <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageUpCommand" />
        </Track.DecreaseRepeatButton>
        <Track.Thumb>
          <Thumb Style="{StaticResource ScrollBarThumb}" Margin="1,0,1,0" Background="{StaticResource HorizontalNormalBrush}" BorderBrush="{StaticResource HorizontalNormalBorderBrush}" />
        </Track.Thumb>
        <Track.IncreaseRepeatButton>
          <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageDownCommand" />
        </Track.IncreaseRepeatButton>
      </Track>
      <RepeatButton Grid.Row="3" Style="{StaticResource ScrollBarLineButton}" Height="18" Command="ScrollBar.LineDownCommand" Content="M 0 0 L 4 4 L 8 0 Z" />
    </Grid>
  </ControlTemplate>

  <ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
    <Grid>
      <Grid.ColumnDefinitions>
        <ColumnDefinition MaxWidth="18" />
        <ColumnDefinition Width="0.00001*" />
        <ColumnDefinition MaxWidth="18" />
      </Grid.ColumnDefinitions>
      <Border Grid.ColumnSpan="3" CornerRadius="2" Background="#F0F0F0" />
      <RepeatButton Grid.Column="0" Style="{StaticResource ScrollBarLineButton}" Width="18" Command="ScrollBar.LineLeftCommand" Content="M 4 0 L 4 8 L 0 4 Z" />
      <Track Name="PART_Track" Grid.Column="1" IsDirectionReversed="False">
        <Track.DecreaseRepeatButton>
          <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageLeftCommand" />
        </Track.DecreaseRepeatButton>
        <Track.Thumb>
          <Thumb Style="{StaticResource ScrollBarThumb}" Margin="0,1,0,1" Background="{StaticResource NormalBrush}" BorderBrush="{StaticResource NormalBorderBrush}" />
        </Track.Thumb>
        <Track.IncreaseRepeatButton>
          <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageRightCommand" />
        </Track.IncreaseRepeatButton>
      </Track>
      <RepeatButton Grid.Column="3" Style="{StaticResource ScrollBarLineButton}" Width="18" Command="ScrollBar.LineRightCommand" Content="M 0 0 L 4 4 L 0 8 Z" />
    </Grid>
  </ControlTemplate>

  <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Style.Triggers>
      <Trigger Property="Orientation" Value="Horizontal">
        <Setter Property="Width" Value="Auto" />
        <Setter Property="Height" Value="18" />
        <Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
      </Trigger>
      <Trigger Property="Orientation" Value="Vertical">
        <Setter Property="Width" Value="12" />
        <Setter Property="Height" Value="Auto" />
        <Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
      </Trigger>
    </Style.Triggers>
  </Style>

  <Style TargetType="{x:Type TabControl}">
    <Setter Property="OverridesDefaultStyle" Value="True" />
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type TabControl}">
          <Grid KeyboardNavigation.TabNavigation="Local">
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
              <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <TabPanel x:Name="HeaderPanel" Grid.Row="0" Panel.ZIndex="1" IsItemsHost="True" KeyboardNavigation.TabIndex="1" Background="{DynamicResource SecondaryBackgroundBrush}" />
            <Border Name="Border" Grid.Row="1" Background="{StaticResource WindowBackgroundBrush}" BorderBrush="{StaticResource SolidBorderBrush}" BorderThickness="1" CornerRadius="2" KeyboardNavigation.TabNavigation="Local" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabIndex="2">
              <ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" />
            </Border>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
              <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <SolidColorBrush x:Key="TabNormalBrush" Color="#01FFFFFF" />
  <SolidColorBrush x:Key="TabNormalBorderBrush" Color="#01FFFFFF" />
  <SolidColorBrush x:Key="TabForegroundBrush" Color="#FF000000" />
  <LinearGradientBrush x:Key="TabSelectedBrush" EndPoint="0,1" StartPoint="0,0">
    <GradientStop Color="#FFFDFEFF" Offset="0" />
    <GradientStop Color="#FFDDE7E6" Offset="0.5" />
    <GradientStop Color="#FFB0C7E6" Offset="0.5" />
    <GradientStop Color="#FFC7D5FA" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="TabSelectedBorderBrush" Color="#FF989FA7" />
  <LinearGradientBrush x:Key="TabHoverBrush" EndPoint="0,1" StartPoint="0,0">
    <GradientStop Color="#FFFDFEFF" Offset="0" />
    <GradientStop Color="#FFDDE7E6" Offset="0.5" />
    <GradientStop Color="#FFBFD7F8" Offset="0.5" />
    <GradientStop Color="#FFE4EBFF" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="TabHoverBorderBrush" Color="#FF989FA7" />

  <Style TargetType="{x:Type TabItem}">
    <Setter Property="Background" Value="{StaticResource TabNormalBrush}" />
    <Setter Property="BorderBrush" Value="{StaticResource TabNormalBorderBrush}" />
    <Setter Property="Foreground" Value="{StaticResource TabForegroundBrush}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type TabItem}">
          <Grid>
            <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,1" CornerRadius="5" Padding="{TemplateBinding Padding}" Margin="5,5,5,5">
              <ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Header" Margin="5,2,5,2" RecognizesAccessKey="True" />
            </Border>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="Background" Value="{StaticResource TabHoverBrush}" />
              <Setter Property="BorderBrush" Value="{StaticResource TabHoverBorderBrush}" />
            </Trigger>
            <Trigger Property="IsSelected" Value="True">
              <Setter Property="Panel.ZIndex" Value="100" />
              <Setter Property="Background" Value="{StaticResource TabSelectedBrush}" />
              <Setter Property="BorderBrush" Value="{StaticResource TabSelectedBorderBrush}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="SliderButtonStyle" TargetType="{x:Type RepeatButton}">
    <Setter Property="SnapsToDevicePixels" Value="true" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="IsTabStop" Value="false" />
    <Setter Property="Focusable" Value="false" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Border Background="Transparent" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="SliderThumbStyle" TargetType="{x:Type Thumb}">
    <Setter Property="SnapsToDevicePixels" Value="true" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="Height" Value="14" />
    <Setter Property="Width" Value="14" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Thumb}">
          <Path Fill="{DynamicResource GlyphBrush}" Stretch="Fill" Stroke="{StaticResource NormalBorderBrush}" StrokeThickness="1" Data="M4.7909554,13.641626 L10.427199,19.419757 15.697845,13.633736 z" Width="14.377" Height="12.737" />
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True" />
            <Trigger Property="IsEnabled" Value="false" />
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <ControlTemplate x:Key="HorizontalSlider" TargetType="{x:Type Slider}">
    <Grid>
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" MinHeight="{TemplateBinding Slider.MinHeight}" />
        <RowDefinition Height="Auto" />
      </Grid.RowDefinitions>
      <TickBar Name="TopTick" SnapsToDevicePixels="True" Placement="Top" Fill="{StaticResource GlyphBrush}" Height="4" Visibility="Collapsed" />
      <Border Name="TrackBackground" Margin="0" CornerRadius="2" Height="4" Grid.Row="1" Background="{StaticResource LightBrush}" BorderBrush="{StaticResource NormalBorderBrush}" BorderThickness="1" />
      <Track Grid.Row="1" Name="PART_Track">
        <Track.DecreaseRepeatButton>
          <RepeatButton Style="{StaticResource SliderButtonStyle}" Command="Slider.DecreaseLarge" />
        </Track.DecreaseRepeatButton>
        <Track.Thumb>
          <Thumb Style="{StaticResource SliderThumbStyle}" />
        </Track.Thumb>
        <Track.IncreaseRepeatButton>
          <RepeatButton Style="{StaticResource SliderButtonStyle}" Command="Slider.IncreaseLarge" />
        </Track.IncreaseRepeatButton>
      </Track>
      <TickBar Name="BottomTick" SnapsToDevicePixels="True" Grid.Row="2" Fill="{TemplateBinding Foreground}" Placement="Bottom" Height="4" Visibility="Collapsed" />
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="TickPlacement" Value="TopLeft">
        <Setter TargetName="TopTick" Property="Visibility" Value="Visible" />
      </Trigger>
      <Trigger Property="TickPlacement" Value="BottomRight">
        <Setter TargetName="BottomTick" Property="Visibility" Value="Visible" />
      </Trigger>
      <Trigger Property="TickPlacement" Value="Both">
        <Setter TargetName="TopTick" Property="Visibility" Value="Visible" />
        <Setter TargetName="BottomTick" Property="Visibility" Value="Visible" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>

  <ControlTemplate x:Key="VerticalSlider" TargetType="{x:Type Slider}">
    <Grid>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="Auto" MinWidth="{TemplateBinding Slider.MinWidth}" />
        <ColumnDefinition Width="Auto" />
      </Grid.ColumnDefinitions>
      <TickBar Name="TopTick" SnapsToDevicePixels="True" Placement="Left" Fill="{StaticResource GlyphBrush}" Width="4" Visibility="Collapsed" />
      <Border Name="TrackBackground" Margin="0" CornerRadius="2" Width="4" Grid.Column="1" Background="{StaticResource HorizontalLightBrush}" BorderBrush="{StaticResource HorizontalNormalBorderBrush}" BorderThickness="1" />
      <Track Grid.Column="1" Name="PART_Track">
        <Track.DecreaseRepeatButton>
          <RepeatButton Style="{StaticResource SliderButtonStyle}" Command="Slider.DecreaseLarge" />
        </Track.DecreaseRepeatButton>
        <Track.Thumb>
          <Thumb Style="{StaticResource SliderThumbStyle}" />
        </Track.Thumb>
        <Track.IncreaseRepeatButton>
          <RepeatButton Style="{StaticResource SliderButtonStyle}" Command="Slider.IncreaseLarge" />
        </Track.IncreaseRepeatButton>
      </Track>
      <TickBar Name="BottomTick" SnapsToDevicePixels="True" Grid.Column="2" Fill="{TemplateBinding Foreground}" Placement="Right" Width="4" Visibility="Collapsed" />
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="TickPlacement" Value="TopLeft">
        <Setter TargetName="TopTick" Property="Visibility" Value="Visible" />
      </Trigger>
      <Trigger Property="TickPlacement" Value="BottomRight">
        <Setter TargetName="BottomTick" Property="Visibility" Value="Visible" />
      </Trigger>
      <Trigger Property="TickPlacement" Value="Both">
        <Setter TargetName="TopTick" Property="Visibility" Value="Visible" />
        <Setter TargetName="BottomTick" Property="Visibility" Value="Visible" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>

  <Style TargetType="{x:Type Slider}">
    <Setter Property="SnapsToDevicePixels" Value="true" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Style.Triggers>
      <Trigger Property="Orientation" Value="Horizontal">
        <Setter Property="MinWidth" Value="104" />
        <Setter Property="MinHeight" Value="21" />
        <Setter Property="Template" Value="{StaticResource HorizontalSlider}" />
      </Trigger>
      <Trigger Property="Orientation" Value="Vertical">
        <Setter Property="MinWidth" Value="21" />
        <Setter Property="MinHeight" Value="104" />
        <Setter Property="Template" Value="{StaticResource VerticalSlider}" />
      </Trigger>
    </Style.Triggers>
  </Style>

  <ControlTemplate x:Key="ExpanderToggleButton" TargetType="ToggleButton">
    <Border Name="Border" CornerRadius="2,0,0,0" Background="Transparent" BorderBrush="{StaticResource NormalBorderBrush}" BorderThickness="0,0,1,0">
      <Path Name="Arrow" Fill="#000" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 0 0 L 4 4 L 8 0 Z" />
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="ToggleButton.IsMouseOver" Value="true">
        <Setter TargetName="Border" Property="Background" Value="{StaticResource HoverBrush}" />
        <Setter TargetName="Arrow" Property="Fill" Value="{StaticResource GlyphBrush}" />
      </Trigger>
      <Trigger Property="IsPressed" Value="true">
        <Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
        <Setter TargetName="Arrow" Property="Fill" Value="{StaticResource GlyphBrush}" />
      </Trigger>
      <Trigger Property="IsChecked" Value="true">
        <Setter TargetName="Arrow" Property="Data" Value="M 0 4 L 4 0 L 8 4 Z" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
        <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
        <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
        <Setter TargetName="Arrow" Property="Fill" Value="{StaticResource DisabledForegroundBrush}" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>

  <Style TargetType="Expander">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Expander">
          <Grid>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
              <RowDefinition Name="ContentRow" Height="0" />
            </Grid.RowDefinitions>
            <Border Name="Border" Grid.Row="0" Background="{StaticResource LightBrush}" BorderBrush="{StaticResource NormalBorderBrush}" BorderThickness="1" CornerRadius="2,2,0,0">
              <Grid>
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="20" />
                  <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <ToggleButton IsChecked="{Binding Path=IsExpanded,Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" OverridesDefaultStyle="True" Template="{StaticResource ExpanderToggleButton}" Background="{StaticResource NormalBrush}" />
                <ContentPresenter Grid.Column="1" Margin="4" ContentSource="Header" RecognizesAccessKey="True" />
              </Grid>
            </Border>
            <Border Name="Content" Grid.Row="1" Background="{StaticResource WindowBackgroundBrush}" BorderBrush="{StaticResource SolidBorderBrush}" BorderThickness="1,0,1,1" CornerRadius="0,0,2,2">
              <ContentPresenter Margin="4" />
            </Border>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsExpanded" Value="True">
              <Setter TargetName="ContentRow" Property="Height" Value="{Binding ElementName=Content,Path=DesiredHeight}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
              <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
              <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
              <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="CheckBoxFocusVisual">
    <Setter Property="Control.Template">
      <Setter.Value>
        <ControlTemplate>
          <Border>
            <Rectangle Margin="15,0,0,0" StrokeThickness="1" Stroke="#60000000" StrokeDashArray="1 2" />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="{x:Type CheckBox}" TargetType="CheckBox">
    <Setter Property="SnapsToDevicePixels" Value="true" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource CheckBoxFocusVisual}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="CheckBox">
          <BulletDecorator Background="Transparent">
            <BulletDecorator.Bullet>
              <Border x:Name="Border" Width="13" Height="13" CornerRadius="0" BorderThickness="1" BorderBrush="{DynamicResource NormalBorderBrush}">
                <Path Width="7" Height="7" x:Name="CheckMark" SnapsToDevicePixels="False" Stroke="#FF101C9B" StrokeThickness="2" Data="M 0 0 L 7 7 M 0 7 L 7 0" />
              </Border>
            </BulletDecorator.Bullet>
            <ContentPresenter Margin="4,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" RecognizesAccessKey="True" />
          </BulletDecorator>
          <ControlTemplate.Triggers>
            <Trigger Property="IsChecked" Value="false">
              <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed" />
            </Trigger>
            <Trigger Property="IsChecked" Value="{x:Null}">
              <Setter TargetName="CheckMark" Property="Data" Value="M 0 7 L 7 0" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter TargetName="Border" Property="Background" Value="{StaticResource HoverBrush}" />
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
              <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource PressedBorderBrush}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
              <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
              <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <ControlTemplate x:Key="ComboBoxToggleButton" TargetType="ToggleButton">
    <Grid>
      <Grid.ColumnDefinitions>
        <ColumnDefinition />
        <ColumnDefinition Width="20" />
      </Grid.ColumnDefinitions>
      <Border x:Name="Border" Grid.ColumnSpan="2" CornerRadius="2" Background="{StaticResource NormalBrush}" BorderBrush="{StaticResource NormalBorderBrush}" BorderThickness="1" />
      <Border Grid.Column="0" CornerRadius="2,0,0,2" Margin="1" Background="{StaticResource WindowBackgroundBrush}" BorderBrush="{StaticResource NormalBorderBrush}" BorderThickness="0,0,1,0" />
      <Path x:Name="Arrow" Grid.Column="1" Fill="{StaticResource GlyphBrush}" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 0 0 L 4 4 L 8 0 Z" />
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="ToggleButton.IsMouseOver" Value="true">
        <Setter TargetName="Border" Property="Background" Value="{StaticResource HoverBrush}" />
      </Trigger>
      <Trigger Property="ToggleButton.IsChecked" Value="true">
        <Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
        <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
        <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
        <Setter TargetName="Arrow" Property="Fill" Value="{StaticResource DisabledForegroundBrush}" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>

  <ControlTemplate x:Key="ComboBoxTextBox" TargetType="TextBox">
    <Border x:Name="PART_ContentHost" Focusable="False" Background="{TemplateBinding Background}" />
  </ControlTemplate>

  <Style x:Key="{x:Type ComboBox}" TargetType="ComboBox">
    <Setter Property="SnapsToDevicePixels" Value="true" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
    <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
    <Setter Property="MinWidth" Value="120" />
    <Setter Property="MinHeight" Value="20" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ComboBox">
          <Grid>
            <ToggleButton Name="ToggleButton" Template="{StaticResource ComboBoxToggleButton}" Grid.Column="2" Focusable="false" IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press">
            </ToggleButton>
            <ContentPresenter Name="ContentSite" IsHitTestVisible="False" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" Margin="3,3,23,3" VerticalAlignment="Center" HorizontalAlignment="Left" />
            <TextBox x:Name="PART_EditableTextBox" Style="{x:Null}" Template="{StaticResource ComboBoxTextBox}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3,3,23,3" Focusable="True" Background="Transparent" Visibility="Hidden" IsReadOnly="{TemplateBinding IsReadOnly}" />
            <Popup Name="Popup" Placement="Bottom" IsOpen="{TemplateBinding IsDropDownOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Slide">
              <Grid Name="DropDown" SnapsToDevicePixels="True" MinWidth="{TemplateBinding ActualWidth}" MaxHeight="{TemplateBinding MaxDropDownHeight}">
                <Border x:Name="DropDownBorder" Background="{StaticResource WindowBackgroundBrush}" BorderThickness="1" BorderBrush="{StaticResource SolidBorderBrush}" />
                <ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True">
                  <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
                </ScrollViewer>
              </Grid>
            </Popup>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="HasItems" Value="false">
              <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
            </Trigger>
            <Trigger Property="IsGrouping" Value="true">
              <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
            </Trigger>
            <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true">
              <Setter TargetName="DropDownBorder" Property="CornerRadius" Value="4" />
              <Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,0" />
            </Trigger>
            <Trigger Property="IsEditable" Value="true">
              <Setter Property="IsTabStop" Value="false" />
              <Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible" />
              <Setter TargetName="ContentSite" Property="Visibility" Value="Hidden" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
    </Style.Triggers>
  </Style>

  <OuterGlowBitmapEffect x:Key="LoginBitmapEffect" GlowColor="#FF000000" Opacity="0.75" />

</ResourceDictionary>
